
#ifndef __MPU6050_H_
#define __MPU6050_H_

#include "driver/i2c.h"

#define MPU6050_I2C_CHANNEL  I2C_NUM_0
#define MPU6050_MASTER_SCL_IO  (5)
#define MPU6050_MASTER_SDA_IO  (4)
#define MPU6050_FREQ_HZ   (100000) // default setting 100Hhz
#define MPU6050_ADDR 0x50   //7 bit address

typedef struct 
{
    char acc_x[8];
    char acc_y[8];
    char acc_z[8];
    char gyro_x[8];
    char gyro_y[8];
    char gyro_z[8];
    char temp[8];
    /* data */
}mpu6050data_t;


esp_err_t mpu6050_i2c_master_init(void);
esp_err_t mpu6050_read_data(uint8_t addr,uint8_t *data,uint16_t size);
esp_err_t mpu6050_write_data(uint8_t addr,uint8_t *data,uint16_t size);
void mpu6050_showdata(void);
void mpu6050_get_data(mpu6050data_t * mpudata);
esp_err_t mpu6050_init(void);
#endif
